package cn.zswltech.gruul.api;

import cn.zswltech.gruul.common.dal.query.SystemConfigQuery;
import cn.zswltech.gruul.common.entity.SystemConfigDO;
import cn.zswltech.gruul.common.result.Response;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * @author Jim
 * @version 1.0.0
 * @descripition:
 * @date 2024/1/29 13:43
 */
// @FeignClient(value = "gruul",path = "/system")
@RequestMapping("system")
public interface SystemApi {
    /**
     * 查询参数配置值（不校验权限）
     *
     * @return
     * @
     */
    @GetMapping("config/value/{key}")
    Response getConfigValue(@PathVariable String key);

    /**
     * 查询系统配置详情（不校验权限）
     *
     * @return
     * @
     */
    @GetMapping("config/detail")
    Response<SystemConfigDO> getConfig(HttpServletRequest request);

    /**
     * 查询系统配置列表
     *
     * @return
     * @
     */
    @GetMapping("config/list")
    Response<Map<String, Object>> getConfigList(SystemConfigQuery query);

    /**
     * 新建系统配置
     *
     * @param request
     * @return
     * @
     */
    @PostMapping("config/create")
    Response createConfig(HttpServletRequest request);



    /**
     * 编辑系统配置
     *
     * @param request
     * @return
     * @
     */
    @PostMapping("config/update")
    Response updateConfig(HttpServletRequest request);

    /**
     * 删除系统配置
     *
     * @param request
     * @return
     * @
     */
    @PostMapping("config/delete")
    Response deleteConfig(HttpServletRequest request);
}
